/*
 *Author:Jackong
 *Date:2012/07/11
 */
#pragma once
#include <buf\recv_buf.h>
#include <buf\send_buf.h>
#include "cln_info.h"

namespace fly {

	namespace jld{

		namespace client {	

		using namespace buffer;
			class cln_handler
			{
			protected:
			cln_handler* cln_handler_;
			TARGET target_;
			bool is_test_;
			public:
				//default the cln_handler with NULL
				cln_handler(bool is_test = false);
				virtual ~cln_handler();
				//set next cln_handler(NULL for tail end)
				cln_handler* set_next(cln_handler* cln_handler);
				
				virtual bool handle_send(recv_buf& recv_buf, send_buf& send_buf, cln_info& info);

				//recv_buf chain of cln_handler
				virtual bool handle_recv(recv_buf& recv_buf, send_buf& send_buf, cln_info& info);

				virtual bool handle_ack(Ack& ack, send_buf& send_buf, cln_info& info);
			};

		}
	}
}